<template>
  <div>
    <tr>
      个人基本信息：😄
    </tr>
    <td>名字：{{ name }}</td>
    <td>生日：{{ birth }}</td>
    <td>年龄：{{ newAge }}</td>
    <button @click="updateAge">修改年龄</button>
  </div>
</template>

<script>
export default {
  // props: ["name", "birth", "age"],
  // props: {
  //   name: String,
  //   birth: Number,
  //   age: Number,
  // },
  props: {
    name: {
      type: String,
      required: true, //必传参数设置
      default: "烦死", //如果设置了必传，必须设置默认值（若父组件中不传任何参数）
    },
    birth: {
      type: Number,
    },
    age: {
      type: Number,
    },
  },
  data() {
    return {
      newAge: this.age,
    };
  },

  methods: {
    updateAge() {
      this.newAge = 88;
    },
  },
};
</script>
<style></style>
